/*
 * FileName: SysLogsService.java
 *
 */
package com.mrc.core.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mrc.core.dao.SysLogsDao;
import com.mrc.core.model.SysLogs;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Mrc
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2017-1-7 下午5:07:38          Mrc        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Service
@Transactional
public class SysLogsService {

    @Autowired
    private SysLogsDao sysLogsDao;

    /**
     * 根据账号，时间  获得用户的操作记录
     * @param account 账号
     * @param dateStr 开始时间  至  结束时间
     * @return
     */
    public List<SysLogs> listByAccount(String account, String dateStr, int logType) {
        return sysLogsDao.listByAccount(account, dateStr, logType);
    }

    /**
     * 保存日志
     * @param logType
     * @param optPerson
     * @param remark
     */
    public void save(Integer logType, String optPerson, String remark) {
        SysLogs logs = new SysLogs();
        logs.setCreateDate(new Date());
        logs.setLogType(logType);
        logs.setOptPerson(optPerson);
        logs.setRemark(remark);
        sysLogsDao.save(logs);
    }

}
